PLC BLOG | Siemens Counter Instructions
Share on Facebook Share On Twitter Share on LinkedIn Share on Whatsapp


lg-12 col-12 fb-share-button">

Share on Facebook

Share on twitter

Share on Whats-App

introduction to siemens Counter Instructions

Counters have memory area reserved for them in the memory of CPU. This memory area reserves one 16-bit word for each counter address. set counter preset value by entering a number from 0 to 999, for example : C#127. The C# stands for binary coded decimal format, 127 is a preset value of a counter. The ladder logic instruction set supports 256 counters. The counter instructions are the only functions that have access to the counter memory area. range for counter PV is 0 to 999. You can vary the count value within this range by using the following counter instructions:

S_CU, Up Counter Instructions

The counter is incremented by one if the signal state at input CU changes from 0 to 1, each rising edge signal at the inputs CU incrment counter value by 1.

siemens Up Counter Instructions


S_CD, Down Counter Instructions

if the set (S) input is 1 and counter value CV is greater than 1. at each rising edge at input CD decremented counter value by 1 untill CV is equal to 0. output Q is 1 if the current counter value is greater than 0. output Q is 0, if the current counter value is equal to zero.

siemens down Counter Instructions


S_CUD Up-Down Counter

Up-Down Counter perform UP or down counting bits , when input of CU changes 0 to 1 than counter increment counter value by 1 and if input CD changes 0 to 1 than counter decremented counter value by 1.output Q is 1 if the counter value is greater than zero and 0.

siemens up/down Counter Instructions


Set Counter Value coil Instructions

this coil set, preset value into the specified counter.

siemens Set Counter Value coil Instructions


Up Counter Coil Instructions

up counter coil incremnt counter value by 1 at specified counter number. each positive edge of the input contact increment counter value by 1 untill counter value is less than 999.

siemens up Counter Value coil Instructions


down Counter Coil Instructions

The Down Counter instruction decrements the value of a specified counter by 1 if there is a signal change 0 to 1 at the input of coil.

siemens down Counter Value coil Instructions


example of siemens counter

in this example counter up instrunction is used, move instrunction set preset value. timer instrunction set 1 at the input of counter CU periodically every 2 second. compariosn block compare preset value and current value if both are equal than counter reset , and start from beginning. counter up reset if the value is greater than Preset value, counter up block input is depent on timer output, reset manually or bit depend on compariosn block.

siemens counter example

siemens counter example

siemens counter example